<%@page import="classes.Subject"%>
<%@page import="classes.SubjectManager"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Subjects</title>
</head>
<body>

<form action="addSubject.jsp" method="post">
<input type="submit" value=addSubject>
</form>


<%
	out.println("subjects <br>");
	SubjectManager subManager = (SubjectManager)application.getAttribute(SubjectManager.SUBJECTMANAGER);
	
	Subject[] subjects = subManager.getAllSubjects();
	
if(subjects.length != 0){
	out.println("<form action=\"redirectingSubject.jsp?\" method=\"get\">");
	out.println("<SELECT NAME=\"subject\" SIZE=\"10\" >");
	for(int i=0; i<subjects.length; i++){
		out.println("<OPTION> " + subjects[i].getSubjectName());
	}
	out.println("</SELECT>");
	out.println("<input type=submit value=edit name=action>");
	out.println("<input type=submit value=remove name=action>");
	out.println("</form>");

}
else{
	out.println("no subjects");
	out.println("</form>");
}




%>

<a href="adminLogin.jsp">go back</a>

</body>
</html>